package com.suxin.classloader;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;

/**
 * @author Tang
 * @classname JarFileArchive
 * @description [  ]
 * @date 2023/1/5 22:45
 */
public class JarFileArchive implements Archive{

    private JarFile jarFile;

    private URL url;

    public JarFileArchive(File file) throws IOException{
        this.jarFile = new JarFile(file);
        this.url = file.toURI().toURL();
    }

    @Override
    public URL getUrl() throws Exception {
        return null;
    }

    @Override
    public Manifest getManifest() throws IOException {
        return null;
    }

    @Override
    public List<Archive> getNestedArchive(EntryFilter filter) {
        return null;
    }

    @Override
    public Iterator<Entry> iterator() {
        Enumeration<JarEntry> entries = this.jarFile.entries();
        return null;
    }
}
